package com.starlight.easybuyprictice.controller;

import com.starlight.easybuyprictice.interceptor.FreeTokenAuthentication;
import com.starlight.easybuyprictice.service.MessageService;
import com.starlight.easybuyprictice.service.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author yfy2001
 * @date 2022/12/3 20:07
 */
@Controller
@RequestMapping("message")
public class MessageController {

    @Autowired
    private MessageService messageService;

    /**
     * 后台获取留言列表
     * @return
     */
    @RequestMapping("/list")
    @ResponseBody
    @FreeTokenAuthentication
    public Result listMessage(){
        return messageService.listMessage();
    }
}
